//
//  Step3Time.m
//  Gunz
//
//  Created by Joggy on 16/4/16.
//  Copyright © 2016年 NUPT. All rights reserved.
//

#import "Step3Time.h"
#import "GZConst.h"

@implementation Step3Time

-(instancetype)initWithTitle:(NSString *)title {
    self = [super initWithFrame:CGRectMake(0, 0, [GZConst getScreenWidth], 17)];
    UILabel *titleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 110*proportion, 17)];
    CGPoint tem = titleLab.layer.position;
    tem.y = self.frame.size.height/2;
    titleLab.layer.position = tem;
    titleLab.textColor = TEXT_TITLE_COLOR;
    titleLab.font = [UIFont systemFontOfSize:14];
    titleLab.textAlignment = NSTextAlignmentRight;
    titleLab.text = title;
    [self addSubview:titleLab];
    _time = [UIButton buttonWithType:UIButtonTypeSystem];
    _time.frame = CGRectMake(0, 0, 175*proportion, 17);
    _time.layer.position = CGPointMake(208*proportion, self.frame.size.height/2);
    _time.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    [_time setAttributedTitle:[[NSAttributedString alloc] initWithString:@"请点击选择时间" attributes:@{NSForegroundColorAttributeName: TEXT_TITLE_COLOR, NSFontAttributeName: [UIFont systemFontOfSize:17]}] forState:UIControlStateNormal];
    [self addSubview:_time];
    return self;
}

-(void)setTimeTitle:(NSString*)title {
    [_time setAttributedTitle:[[NSAttributedString alloc] initWithString:title attributes:@{NSForegroundColorAttributeName: TEXT_TITLE_COLOR, NSFontAttributeName: [UIFont systemFontOfSize:17]}] forState:UIControlStateNormal];
}

@end
